home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Sample Code / Http Server / •OT_Classes / TNetworkServerApp.cp < prev    next >
Encoding:
Text File  |  1996-01-11  |  2.1 KB  |  65 lines  |  [TEXT/CWIE]

  1. //    TNetworkServerApp.cp - Macintosh OpenTransport Network Server Application class object
  2. // 
  3. // Apple Macintosh Developer Technical Support
  4. // Written by:  Vinne Moscaritolo
  5. //
  6. //  Copyright (work in progress)  Apple Computer, Inc All rights reserved.
  7. //
  8. // You may incorporate this sample code into your applications without
  9. // restriction, though the sample code has been provided "AS IS" and the
  10. // responsibility for its operation is 100% yours.  However, what you are
  11. // not permitted to do is to redistribute the source as "DSC Sample Code"
  12. // after having made changes. If you're going to re-distribute the source,
  13. // we require that you make it clear in the source that the code was
  14. // descended from Apple Sample Code, but that you've made changes.
  15. // 
  16.  
  17. #include "TNetworkServerApp.h"
  18. #include "TNetworkEventHandler.h"
  19. #include "TThread.h"
  20.  
  21. // ---------------------------------------------------------------------------
  22. //     TNetworkServerApp
  23. // ---------------------------------------------------------------------------
  24. //    Default Constructor
  25.  
  26. TNetworkServerApp::TNetworkServerApp()
  27. {
  28.     ThrowIfOTErr( ::InitOpenTransport());
  29.     fSleepTime =     kNoSleep;        // network task doesnt sleep
  30. }
  31.  
  32. // ---------------------------------------------------------------------------
  33. //     ~TNetworkServerApp
  34. // ---------------------------------------------------------------------------
  35. //    Destructor
  36.  
  37. TNetworkServerApp::~TNetworkServerApp()
  38. {
  39. };
  40.  
  41.  
  42. // ---------------------------------------------------------------------------
  43. //     TNetworkServerApp::Start()
  44. // ---------------------------------------------------------------------------
  45. //    
  46.  
  47. void TNetworkServerApp::Start()
  48. {
  49. // handle any specific startup issues.        
  50.  
  51.     TBackGroundApp::Start();        // call the inherited Start
  52. }
  53.  
  54.  
  55. // ---------------------------------------------------------------------------
  56. //     TNetworkServerApp::DoIdle()
  57. // ---------------------------------------------------------------------------
  58. // process any network events    durring idle time    
  59.  
  60. void TNetworkServerApp::DoIdle()
  61. {
  62.     TNetworkEventHandler::ScanEventHandlerQueue();
  63.     TThread::Yield();
  64. }
  65.